import React from 'react'
import ReactDOM from 'react-dom'
import Routers from './router/Routers';
import "./index.css";
// 引入ant design样式
import 'antd/dist/antd.css';
// 统一追加url的基础路径
import { createHttp, onHttpError } from "./utils/requests";
createHttp({ baseURL: "/api" });
import { notification } from 'antd';
onHttpError(({ status, message }) => {
  if (status === 401) {
    sessionStorage.removeItem('token');
    notification['error']({
        message: `${message}`,
        description:
          'The world is suidernly late the mountains rivers sre slready autum.',
        duration:2
    });
  }
});
ReactDOM.render(
  <React.StrictMode>
    <Routers />
  </React.StrictMode>,
  document.getElementById('root')
)
